package com.panshi.service;

import com.panshi.entity.AppUserMassageT;
import com.panshi.entity.AppUserT;
import com.panshi.result.R;
import com.panshi.service.impl.UserClientServiceFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
@FeignClient(value = "HASBEI-USER-PROVIDER-8001-XHLMR",fallbackFactory = UserClientServiceFallbackFactory.class)
public interface UserClientService {

    @ApiOperation("用户ID查询用户信息")
    @GetMapping("/app-user-massage-t/getUserMassage/{userId}/{page}")
    public List<AppUserMassageT> getUserMassage(@PathVariable int userId,@PathVariable int page);

    @ApiOperation("站内信息确认")
    @GetMapping("/app-user-massage-t/userMsgStatus/{id}")
    public Boolean userMsgStatus(@PathVariable int id);

    @PostMapping("/app-user-t/login")
    public R login(AppUserT appUserT);

    @GetMapping("/app-user-t/all")
    public List<AppUserT> all();

    @GetMapping("/app-user-t/byid/{id}")
    public AppUserT byid(@PathVariable Integer id);

    @PostMapping("/app-user-t/add")
    public Boolean add(AppUserT appUserT);

    @GetMapping("/user/memberStop/{id}/{type}")
    public Boolean memberStop(@PathVariable int id,@PathVariable String type);

    @GetMapping("/app-user-t/del/{id}")
    public Boolean del(@PathVariable Integer id);

    @PostMapping("/app-user-t/upd")
    public Boolean upd(AppUserT appUserT);

    @ApiOperation("用户修改 按ID")
    @PostMapping("user/upd")
    public R userUpdate(@RequestBody AppUserT appUserT);

    @ApiOperation("按用户名查询  加分页")
    @GetMapping("/user/getUserByName/{userNickname}/{page}/{limit}")
    public List<AppUserT> getUserLikeName(@PathVariable String userNickname,@PathVariable int page,@PathVariable int limit);

    @ApiOperation("按分页查询全部")
    @GetMapping("/user/getUserPageAll/{page}/{limit}")
    public List<AppUserT> getUserPageAll(@PathVariable int page,@PathVariable int limit);

    @ApiOperation("用户注册")
    @GetMapping("/app-user-t/add/{userName}/{code}/{userPassword}/{type}")
    public R userAdd(@PathVariable String userName,@PathVariable String code,@PathVariable String userPassword,@PathVariable String type);

    @ApiOperation("验证前台用户  是否有效 有效重新返回用户对象")
    @GetMapping("/app-user-t/veruser/{userBank}/{userPassword}")
    public AppUserT getVeruser(@PathVariable String userBank,@PathVariable String userPassword);

    @ApiOperation("用户获取验证码")
    @GetMapping("/app-user-t/reg/{type}/{username}/{form}")
    public R reg(@PathVariable String type,@PathVariable String username,@PathVariable String form);

    @ApiOperation(" 用户 找回密码")
    @GetMapping("/findpwd/{username}/{userpassword}/{code}/{type}")
    public R findpwd(@PathVariable String username,@PathVariable String userpassword,@PathVariable String code,@PathVariable String type);


    @ApiOperation("用户手机号修改")
    @GetMapping("/app-user-t/userPhoneUpd/{userName}/{code}/{userId}")
    public R userPhoneUpd(@PathVariable String userName,@PathVariable String code,@PathVariable int userId);

    @ApiOperation("用户邮箱号修改")
    @GetMapping("/app-user-t/userEmailUpd/{userName}/{code}/{userId}")
    public R userEmailUpd(@PathVariable String userName,@PathVariable String code,@PathVariable int userId);

    @ApiOperation("修改密码")
    @PostMapping("/app-user-t/userUpdatePwd")
    public Boolean userUpdatePwd(@RequestBody AppUserT appUserT);

    @ApiOperation("修改用户图片")
    @PostMapping("/app-user-t/userImgUpload")
    public Boolean userImgUpload(@RequestBody AppUserT appUserT);
}
